<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <span>JS是一门编程语言，学完js工资会很高</span>
    <script>
        const str = 'JS是一门编程语言，学完js工资会很高'
        const s=str.replace(/js/,'前端')
        const so=str.replace(/js/i,'前端')
        const son=str.replace(/js/g,'前端')
        const sond=str.replace(/js/ig,'前端')

       
        console.log(/^JS$/i.test('JS'))
        console.log(/^JS$/g.test('JS'))
        console.log(/^JS$/ig.test('JS'))
        console.log(son);
        console.log(s);
        console.log(so);
        console.log(sond);
           
        
        
        
        
        
    </script>
</body>
</html>